package pl.jtb.ctl.tabory.ui.boe.ui.handlers;

import org.apache.log4j.Logger;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;

import pl.jtb.ctl.tabory.ui.boe.ui.he.HistoricalDataEditor;
import pl.jtb.ctl.tabory.ui.editors.OpenViewTripEditorAction;

public class OpenHsitoricalDataEditorHandler extends AbstractHandler {

    private final static Logger log = Logger.getLogger(OpenTripEditorHandler.class);

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {
        log.debug("opening historical data editor");
        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
        OpenViewTripEditorAction action = new OpenViewTripEditorAction(window, "label", HistoricalDataEditor.ID);
        action.run();
        return null;
    }
}
